﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;

/// <summary>
/// dbConnection의 요약 설명입니다.
/// </summary>
public class dbConnection
{
	public dbConnection()
	{
		//
		// TODO: 생성자 논리를 여기에 추가합니다.
		//
	}

    public static SqlConnection getConnection(String mapPath)
    {
        SqlConnection connection = null;
        try
        {
            string connString = @"Data Source=(local)\SQLExpress;Integrated Security=true;AttachDbFilename=" + mapPath + @"\App_Data\Database.mdf;User Instance=true;";
            connection = new SqlConnection(connString);
        }
        catch (SqlException ex)
        {
            Console.Write(ex.ToString());
        }

        return connection;
    }
}
